package com.facebook.app.client.event;

import java.util.List;

import com.facebook.app.shared.clustering.Clusterable;
import com.google.gwt.event.shared.GwtEvent;

public class ReadyForClusteringEvent extends GwtEvent<ReadyForClusteringEventHandler> {
	
	public static final Type<ReadyForClusteringEventHandler> TYPE = new Type<ReadyForClusteringEventHandler>();
	
	private final List<Clusterable> clusterElements;
	
	public ReadyForClusteringEvent(List<Clusterable> clusterElements) {
		this.clusterElements = clusterElements;
	}
	
	public List<Clusterable> getClusterElements() {
		return clusterElements;
	}
	
	@Override
	public Type<ReadyForClusteringEventHandler> getAssociatedType() {
		return TYPE;
	}
	
	@Override
	protected void dispatch(ReadyForClusteringEventHandler handler) {
		handler.onReadyForClustering(this);
	}

}
